package nz.co.senanque.bundle2;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.annotation.Autowired;

import nz.co.senanque.perspectivemanager.App;
import nz.co.senanque.perspectivemanager.AppFactory;
import nz.co.senanque.perspectivemanager.Blackboard;
import nz.co.senanque.bundle2.TestSessionBean;

/**
 * @author Roger Parkinson
 *
 */
public class AppFactoryImpl implements AppFactory, BeanFactoryAware {
	
	private BeanFactory m_beanFactory;
//	private TestSessionBean m_testSessionBean;
	/* (non-Javadoc)
	 * @see nz.co.senanque.bundle1.AppFactory#createApp()
	 */
	@Override
	public App createApp(Blackboard blackboard)
	{
		App ret = new App();
		final Layout layout = new Layout();
		layout.setBlackboard(blackboard);
		ret.setComponentContainer(layout);
//		Object o = m_beanFactory.getBean("testSessionBean");
//		o.toString();
		return ret;
	}
	public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
		m_beanFactory = beanFactory;
	}
//	public TestSessionBean getTestSessionBean() {
//		return m_testSessionBean;
//	}
//
//	public void setTestSessionBean(TestSessionBean testSessionBean) {
//		m_testSessionBean = testSessionBean;
//	}

}
